using System;
using OS.Infrastructure.Domain;

namespace TaskKernel.Domain
{
    public class WorkingPeriod : AbstractEntity
    {
        public virtual DateTime StartTime { get; protected set; }
        public virtual DateTime? StopTime { get; protected set; }
        public virtual Task Task { get; protected set; }
        public virtual Account Owner { get; protected set; }
        protected WorkingPeriod()
        {

        }

        public WorkingPeriod(Task task, Account owner)
            : this()
        {
            Task = task;
            Owner = owner;
            Start();
        }
        public virtual void Start()
        {
            StartTime = DateTime.Now;
        }
        public virtual void End()
        {
            StopTime = DateTime.Now;
        }

    }
}